package com.avcdata.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;

@Controller
public class UserController {

    @RequestMapping("/user")
    public String user(@RequestParam(value = "name", defaultValue = "world") String search, Model model) {
        List<String> users = new ArrayList<>();
        users.add("黄成");
        users.add("123");
        users.add("321");
        model.addAttribute("users", users);
        model.addAttribute("search", search);
        return "user";
    }
}
